<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="Ads.aspx.cs" Inherits="FreeLancer.HRB.WebApp.Admin.Pages.Ads" Title="<%$ Resources:labels, ads %>" %>

<%@ Register Assembly="DevExpress.Web.v8.1, Version=8.1.1.0, Culture=neutral, PublicKeyToken=49d90c14d24271b5"
  Namespace="DevExpress.Web.ASPxCallbackPanel" TagPrefix="dxcp" %>
<%@ Register Assembly="DevExpress.Web.v8.1, Version=8.1.1.0, Culture=neutral, PublicKeyToken=49d90c14d24271b5"
  Namespace="DevExpress.Web.ASPxRoundPanel" TagPrefix="dxrp" %>

<%@ Register Assembly="DevExpress.Web.ASPxEditors.v8.1, Version=8.1.1.0, Culture=neutral, PublicKeyToken=49d90c14d24271b5"
  Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.v8.1, Version=8.1.1.0, Culture=neutral, PublicKeyToken=49d90c14d24271b5"
  Namespace="DevExpress.Web.ASPxUploadControl" TagPrefix="dxuc" %>
<%@ Register Assembly="DevExpress.Web.v8.1, Version=8.1.1.0, Culture=neutral, PublicKeyToken=49d90c14d24271b5"
  Namespace="DevExpress.Web.ASPxDataView" TagPrefix="dxdv" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script type="text/javascript" src="../../javascript/admin.js"></script>
  <div style="margin-bottom: 10px;">
    <%--<span><%=Resources.labels.language %></span>--%>
    <%--<asp:DropDownList runat="server" ID="cboLanguage" Width="100px" 
      OnSelectedIndexChanged="cboLanguage_SelectedIndexChanged" AutoPostBack="true">
    </asp:DropDownList>--%>
  </div>
  <div>
    <dxdv:ASPxDataView ID="ASPxDataView" runat="server" RowPerPage="2" ColumnCount="5" 
      Width="1000px" ItemSpacing="2px" ItemStyle-Height="140px" OnCustomCallback="ASPxDataView_OnCustomCallback"
      ClientInstanceName="ciAds_ASPxDataView">
      <ItemTemplate>
        <div>
          <dxe:ASPxImage ID="ASPxImageEvent" runat="server" Height="120px" Width="180px"
            ImageUrl='<%# "~/Images/AdImages/"+Eval("Path") %>'/>
          <br />
          <dxe:ASPxHyperLink ID="ASPxLinkDelete" runat="server" 
            Text="<%$ Resources:labels, cmdDelete %>" 
            NavigateUrl='<%# "javascript:Ads_DeleteImage(" + Eval("AdvID") + ",\"" + Resources.labels.cmdConfirmDelete + "\")" %>'></dxe:ASPxHyperLink>
          <dxe:ASPxHyperLink ID="ASPxLinkEdit" runat="server" 
            Text="<%$ Resources:labels, cmdUpdate %>" 
            NavigateUrl='<%# "javascript:Ads_UpdateImage(" + Eval("AdvID") + ")" %>'></dxe:ASPxHyperLink>
          <%--<dxe:ASPxImage ID="ASPxImageEvent" runat="server"></dxe:ASPxImage>--%>
        </div>
      </ItemTemplate>
    </dxdv:ASPxDataView>
  </div>
  <div>
      <dxcp:ASPxCallbackPanel ID="ASPxCallbackPanel" runat="server" Width="100%"
        ClientInstanceName="ciAds_ASPxCallbackPanel" OnCallback="ASPxCallbackPanel_OnCallback">
        <PanelCollection>
          <dxrp:PanelContent runat="server">
            <table id="entrySettings"> 
              <tr>
                <td class="label"><%=Resources.labels.imageTitle %></td>
                <td>
                  <dxe:ASPxTextBox ID="ASPxTextBoxImageTitle" ClientInstanceName="ciAds_ASPxTextBoxImageTitle"
                    runat="server" Width="400px">
                  </dxe:ASPxTextBox>
                </td>
              </tr>
              <tr  style="vertical-align:top;">
                <%--<td class="label"><%=Resources.labels.description %></td>
                <td>
                  <dxe:ASPxMemo ID="ASPxMemoImageDescription" runat="server" Height="130px" Width="400px"
                    ClientInstanceName="ciEvents_ASPxMemoImageDescription">
                  </dxe:ASPxMemo>
                </td>--%>
              </tr>
              <tr>
                <td class="label"><%=Resources.labels.imageLink %></td>
                <td>
                  <dxe:ASPxTextBox ID="ASPxTextBoxImageLink" ClientInstanceName="ciAds_ASPxTextBoxImageLink"
                    runat="server" Width="400px" >
                  </dxe:ASPxTextBox>
                </td>
              </tr>
              <tr>
                <td>
                  <span><%=Resources.labels.descriptionImage %></span>
                </td>
                <td>
                  <table>
                    <tr>
                      <td>
                        <dxuc:ASPxUploadControl ID="ASPxUploadControl" runat="server"
                          OnFileUploadComplete="ASPxUploadControl_FileUploadComplete" 
                          ClientInstanceName="ciAds_ASPxUploadControl" Width="50px">
                          <ValidationSettings AllowedContentTypes="image/jpeg,image/pjpeg,image/gif,image/png,image/x-png"
                            NotAllowedContentTypeErrorText="<%$ Resources:labels, notAllowedContentTypeErrorText %>" 
                            FileDoesNotExistErrorText="<%$ Resources:labels, fileDoesNotExistErrorText %>"
                            MaxFileSize="2000000"
                            MaxFileSizeErrorText="<%$ Resources:labels, maxFileSizeErrorText %>">
                          </ValidationSettings>
                          <ClientSideEvents FileUploadComplete="function(s,e) { ciAds_ASPxUploadControl_FileUploadComplete(s,e); }"/>
                        </dxuc:ASPxUploadControl>
                      </td>
                      <td>
                        <dxe:ASPxButton ID="ASPxButtonUpload" runat="server" Text="<%$ Resources:labels, btnUploadText %>" AutoPostBack="false">
                          <ClientSideEvents Click="function(s,e) { ciAds_ASPxButtonUpload_Click(s,e); }"/>
                        </dxe:ASPxButton>
                      </td>
                      <td>
                        <dxe:ASPxButton ID="ASPxButtonUpdate" runat="server" Text="<%$ Resources:labels, cmdUpdate %>" AutoPostBack="false"
                          OnClick="ASPxButtonUpdate_OnClick">
                            <ClientSideEvents Click="function(s,e) { ciAds_ASPxButtonUpdate_Click(s,e); }"/>
                        </dxe:ASPxButton>
                      </td>
                      <td>
                        <dxe:ASPxButton ID="ASPxButtonClear" runat="server" Text="<%$ Resources:labels, cmdCancel %>" AutoPostBack="false">
                          <ClientSideEvents Click="function(s,e) { ciAds_ASPxButtonClear_Click(s,e); }"/>
                        </dxe:ASPxButton>
                      </td>
                      
                    </tr>
                  </table>
                </td>
                <td>
                  <dxe:ASPxTextBox ID="ASPxTextBoxImageName" runat="server" ClientInstanceName="ciAds_ASPxTextBoxImageName" 
                    ReadOnly="true" Border-BorderStyle="None" BackColor="Transparent" ForeColor="#f1f1f1" Width="0px">
                  </dxe:ASPxTextBox>
                </td>
              </tr>
              <tr>
                <td class="label"><%=Resources.labels.index %></td>
                <td>
                  <dxe:ASPxTextBox ID="ASPxTextBoxIndex" ClientInstanceName="ciAds_ASPxTextBoxIndex"
                    runat="server" Width="50px" >
                  </dxe:ASPxTextBox>
                </td>
              </tr>
              <tr>
                <td></td>
                <td>
                  <dxe:ASPxImage ID="ASPxImage" runat="server" 
                    ClientInstanceName="ciAds_ASPxImage" 
                    Height="120px" Width="180px">
                  </dxe:ASPxImage>
                </td>
              </tr>
              <%--<tr>
                <td class="label"><%=Resources.labels.settings %></td>
                <td><asp:CheckBox runat="Server" ID="chkIsPublished" Checked="true" Text="<%$ Resources:labels, approved %>" /></td>
              </tr>
              <tr>
                <td></td>
                <td><asp:CheckBox runat="Server" ID="chkIsCommentAllowed" Checked="true" Text="<%$ Resources:labels, isCommentAllowed %>" /></td>
              </tr>--%>
            </table>
          </dxrp:PanelContent>
        </PanelCollection>
      </dxcp:ASPxCallbackPanel>
        
      
      <%--<div style="text-align:right">
        <asp:Label runat="server" ID="lblError"></asp:Label>
        <asp:Label runat="server" ID="lblInfo"></asp:Label>
        <asp:Button runat="server" ID="btnSave" Text="<%$ Resources:labels, cmdUpdate %>" OnClick="btnSave_Click"/>
        <asp:Button runat="server" ID="btnDelete" Text="<%$ Resources:labels, cmdDelete %>" OnClick="btnDelete_Click" 
          OnClientClick="<%$ Resources:labels, scriptConfirm %>"/>
      </div>--%>
      <div style="text-align:right; color:Red; margin-top: 10px;">
        <asp:Label runat="server" ID="lblErrorUpdateFailed" Visible="false"
          Text="<%$ Resources:labels, infoUpdateFailed %>"></asp:Label>
        <asp:Label runat="server" ID="lblErrorLoadFailed" Visible="false"
          Text="<%$ Resources:labels, infoLoadFailed %>"></asp:Label>
        <asp:Label runat="server" ID="lblErrorDeleteFailed" Visible="false"
          Text="<%$ Resources:labels, infoDeleteFailed %>"></asp:Label>  
      </div>
    </div>
</asp:Content>
